ImagXpress 13 for ActiveX - User Guide > How To > Print an Image |
ImagXpress® enables you to print an image, using either ImagXpress or PrintPRO™.
ImagXpress enables the user to print an image. This can be the easiest way to print the image, if the DC and printed page coordinates are known. ImagXpress provides an easy way to print.
Use the PrintImage method to print an image:
The following code prints the current ImagXpress image in the upper left corner of the printed page.
VB Example |
Copy Code
|
---|---|
ImagXpress1.FileName = "C:\IMAGES\BIRD.JPG" Printer.Print "" ' Assumes twips so use ImagWidth and ImagHeight ImagXpress1.PrintImage Printer.hDC, 0, 0, ImagXpress1.ImagWidth, ImagXpress1.ImagHeight, IX_GraphicsUnit_Twip, IX_PrintType_FullImage Printer.EndDoc |
The ImagXpress PrintImage method requires a printer DC from the container. However, in some containers, a printer DC is not available. In this case, PrintPRO provides a vehicle to print to a selected printing device. PrintPRO also may provide the best solution if you require a customized printer interface and programmatic control over printing functions.
VB Example |
Copy Code
|
---|---|
// This code demonstrates how to print an image using ImagXpress and PrintPRO Dim a As Integer Dim b As Integer PrintPRO1.hDIB = Xpress1.hDIB PrintPRO1.ScaleMode = SCALE_Pixel PrintPRO1.StartPrintDoc a = PrintPRO1.ScaleWidth - PrintPRO1.LMargin b = PrintPRO1.ScaleHeight - PrintPRO1.TMargin - PrintPRO1.BMargin PrintPRO1.PrintDIB PrintPRO1.LMargin, PrintPRO1.TMargin, a, b, 0, 0, 0, 0, True PrintPRO1.EndPrintDoc |
VB Example |
Copy Code
|
---|---|
// This code demonstrates how to print a multi-page TIFF image using ImagXpress and PrintPRO PrintPRO1.PrintDialog PrintPRO1.StartPrintDoc For counter = 1 To IX1.NumPages(IX1.FileName) IX1.PageNbr = counter IX1.FileName = IX1.FileName PrintPRO1.hDIB = IX1.hDIB a = PrintPRO1.ScaleWidth - 1 - PrintPRO1.LMargin b = PrintPRO1.ScaleHeight - 1 - PrintPRO1.Tmargin - PrintPRO1.BMargin PrintPRO1.PrintDIB PrintPRO1.LMargin, PrintPRO1.TMargin, a, b, 0, 0, 0, 0, True PrintPRO1.NewPage Next counter PrintPRO1.EndPrintDoc |
Color management is performed to ensure that the image has a similar appearance, regardless of the device on which it is displayed or printed. When printing an image, the image must be converted to the device-specific color space of the specified printer. This conversion can be done at a number of different points in the process:
To perform color management with ImagXpress: